Python: how how to divide elements of arrays based on condition

visit shbcf.ru